﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Dack_Web2
{
    public class GioHang
    {
        public static int GiaSanPham(int MaDeal)
        {
            int Gia = 0;
            string sql = "select Giam from [Deal] where MaDeal = " + MaDeal;
            int Giam =int.Parse(Sql_DataProvider.SQL_ExecuteScalar(sql).ToString());
            sql = "select GiaSanPham from [SanPham] sp,  [Deal] dl where sp.MaSanPham = dl.MaSanPham and MaDeal = " + MaDeal;
            int GiaGoc = int.Parse(Sql_DataProvider.SQL_ExecuteScalar(sql).ToString());
            Gia = GiaGoc - (GiaGoc/ 100)*Giam;
            return Gia;
        }
    }
}